import Layout from '@/layout'

export default [
  // 动态路由配置,需要权限的路由
  {
    path: '/departments',
    component: Layout,
    meta: {
      name: 'departments'
    },
    children: [
      {
        path: '',
        name: 'departments',
        component: () => import('@/views/departments/index'),
        // 组织架构
        meta: { title: 'route.departments', icon: 'tree' }
      }
    ]
  },
  {
    path: '/employees',
    component: Layout,
    meta: {
      name: 'employees'
    },
    children: [
      {
        path: '',
        name: 'employees',
        component: () => import('@/views/employees/index'),
        // 员工
        meta: { title: 'route.employees', icon: 'people' }
      },
      {
        path: 'upload',
        component: () => import('@/views/employees/Upload.vue'),
        hidden: true
      },
      {
        path: 'detail/:id',
        component: () => import('@/views/employees/Detail.vue'),
        hidden: true
      }
    ]
  },
  {
    path: '/setting',
    component: Layout,
    meta: {
      name: 'settings'
    },
    children: [
      {
        path: '',
        name: 'setting',
        component: () => import('@/views/setting/index'),
        // 公司设置
        meta: { title: 'route.settings', icon: 'setting' }
      }
    ]
  },
  {
    path: '/salarys',
    component: Layout,
    meta: {
      name: 'salarys'
    },
    children: [
      {
        path: '',
        name: 'salarys',
        component: () => import('@/views/salarys/index'),
        // 工资
        meta: { title: 'route.salarys', icon: 'money' }
      }
    ]
  },
  {
    path: '/social',
    component: Layout,
    meta: {
      name: 'social_security'
    },
    children: [
      {
        path: '',
        name: 'social',
        component: () => import('@/views/social/index'),
        // 社保
        meta: { title: 'route.social_securitys', icon: 'table' }
      }
    ]
  },
  {
    path: '/attendances',
    component: Layout,
    meta: {
      name: 'attendances'
    },
    children: [
      {
        path: '',
        name: 'attendances',
        component: () => import('@/views/attendances/index'),
        // 考勤
        meta: { title: 'route.attendances', icon: 'skill' }
      }
    ]
  },
  {
    path: '/approvals',
    component: Layout,
    meta: {
      name: 'approvals'
    },
    children: [
      {
        path: '',
        name: 'approvals',
        component: () => import('@/views/approvals/index'),
        // 审批
        meta: { title: 'route.approvals', icon: 'tree-table' }
      }
    ]
  },
  {
    path: '/permission',
    component: Layout,
    meta: {
      name: 'permissions'
    },
    children: [
      {
        path: '',
        name: 'permission',
        component: () => import('@/views/permission/index'),
        // 权限管理
        meta: { title: 'route.permissions', icon: 'lock' }
      }
    ]
  }
]
